package com.gitee.feizns.convert.impl;

import com.gitee.feizns.convert.Converter;
import com.gitee.feizns.convert.DateConvertUtils;
import lombok.NonNull;

import java.util.Date;

/**
 * @author feizns
 * @since 2019/5/19 0019
 */
public class DateConverter implements Converter<Object, Date> {

    @Override
    public Date to(@NonNull Object original, Class<? extends Date> targetType) {
        return DateConvertUtils.to(original, targetType);
    }

    @Override
    public boolean support(Class<?> targetType) {
        return java.util.Date.class.isAssignableFrom(targetType);
    }

}
